package com.lyf.spring.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController//写了这个东西就会被扫描，如果不写看不见就扫描不到
public class HelloController {

    //http:127.0.0.1:8080/hello
    //127.0.0.1本机，8080端口号，hello表示资源路径
    //支持get又支持post
    @RequestMapping("/hello")//在localhost后面加这个接口就能够访问到
    //@RequestMapping(value = "m2",method = RequestMethod.GET)这种就只支持get请求
    public String hello(){
        int a=10;
        return "hello spring boot-";
    }
}
